package
{
	import com.flashdynamix.utils.SWFProfiler;
	
	import controller.EventController;
	
	import flash.display.StageAlign;
	import flash.display.StageScaleMode;
	
	import model.Service;
	
	import mx.core.Application;
	
	import subumbo.audio.core.AudioEngine;
	import subumbo.audio.core.Utils;

	public class MainController extends Application
	{
		private var _eventController:EventController;
		private var _services:Service;
		protected var _audio:AudioEngine;
		
		[Bindable] protected var numActive:String = "0";
		[Bindable] protected var numGenerators:String = "0";
		[Bindable] protected var processors:Array = [];
		[Bindable] protected var 	numChannelEffects:String = "0"
		public function MainController()
		{
			super();
		}
		
		protected function init():void
		{
			// DEBUGGER
			SWFProfiler.init(systemManager.stage,this);
			
			systemManager.stage.scaleMode = StageScaleMode.NO_SCALE;
			systemManager.stage.align = StageAlign.TOP_LEFT;
			_eventController = new EventController();
			_services = new Service();
				
			_audio = AudioEngine.instance;
			_audio.debugger = debugUpdate;
			
			//new ApplicationEvent(ApplicationEvent.GET_DATA).dispatch();
		}
		
		public function debugUpdate(obj:Object):void
		{
			numActive = obj.processQue.length;
			numGenerators = obj.numGenerators;
			numChannelEffects = obj.numChannelEffects;
			processors = Utils.processQueToArray(obj.processQue);
		
		}
		
		protected function addGenerator():void
		{
			
		}
	}
}